package com.example.android;

import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;

import androidx.appcompat.app.AppCompatActivity;

public class NewPage extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.newpage);
        FrameLayout frame = (FrameLayout)findViewById(R.id.newLyout);
        final MEIZI meizi = new MEIZI(NewPage.this);
        meizi.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                meizi.X = motionEvent.getX() - 100;
                meizi.Y = motionEvent.getY() - 100;
                return false;
            }
        });
        frame.addView(meizi);
    }
}